#pragma once

#include "cartographer/rcm/imu/common.h"

namespace cartographer
{
    class ImuExponentialFilter
    {
    public:
        using Ptr = std::shared_ptr<ImuExponentialFilter>;

        ImuExponentialFilter(double threshTime);

        // ImuExponentialFilter(Eigen::Vector3d threshAcc, Eigen::Vector3d threshGyro);

        ImuMeasure Estimate(const ImuMeasure &last, const ImuMeasure &curr);

        bool filterGyro_;
        double threshTime_;
        double intervalMax_;
        Eigen::Vector3d threshAcc_;
        Eigen::Vector3d threshGyro_;
    };

    class LMSFilter
    {
    public:
        LMSFilter(size_t size, double stride);

        bool Update(const std::vector<double> &inputs, const double expect, double &output);

    private:
        size_t size_;
        double stride_;
        std::vector<double> weights;
    };
} // namespace cartographer